<%@ page language="java" contentType="text/html; charset=utf-8"
         pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<html>
<head>
    <script type="text/javascript">
        function deleteBook(id) {
            window.location.reload = "deleteBookServlet?id=" + id;

        }
        function editBook() {
            $('form').submit();

        }
    </script>
    <link href="css/bootstrap.min.css" rel="stylesheet">
    <script src="js/jquery.min.js"></script>
    <script src="js/bootstrap.min.js"></script>
</head>
<body>
<h2 align="center">后台管理-图书</h2>
<a href='bookAdd'><img src="img/add.png"></a>
<div id="logout" align="right"><a href="logout">注销</a></div>
<table class="table  table-bordered">
    <thead>
    <tr>
        <th scope="col">序号</th>
        <th scope="col">书名</th>
        <th scope="col">作者</th>
        <th scope="col">价格</th>
        <th scope="col">出版社</th>
        <th scope="col">ISBN</th>
    </tr>
    </thead>
    <tbody>
    <c:forEach items="${books }" var="book" varStatus="s">
        <form name='form' action='showUpdateInfoServlet'>
            <input type="hidden" name="id" value="${book.id}" />
            <tr>
                <th scope="row">${s.index+1 }</th>
                <td>${book.name }</td>
                <td>${book.author }</td>
                <td>${book.price }</td>
                <td>${book.press }</td>
                <td>${book.ISBN }</td>
            </tr>
        </form>
    </c:forEach>
    </tbody>
</table>
</body>
</html>